<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
	xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
	layout:decorator="layout/default">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>创建新用户</title>
</head>
<body>
	<div layout:fragment="content">
		<form class="form-horizontal" action="" method="POST"
			th:action="@{/users/save}" th:object="${authUser}">
			<fieldset>
				<legend>创建新用户</legend>
				<input type="hidden" id="action" name="action" value="insert" />
				<div class="form-group"
					th:classappend="${#fields.hasErrors('userName')} ? 'has-error'">
					<label for="userName"
						class="col-lg-2 col-md-2 col-sm-2 hidden-xs control-label">登录名称</label>
					<div class="col-lg-10 col-md-10 col-sm-10 col-xs-12">
						<input type="text" class="form-control input-sm"
							th:field="*{userName}" maxLength="64" required="required"
							requireText="请输入登录用户名" placeHolder="登录用户名" autofocus="autofocus" />
						<small class="help-block">用户名长度需在4到64位之间</small> <small
							class="text-warning" th:if="${#fields.hasErrors('userName')}"
							th:errors="*{userName}"></small>
					</div>
				</div>
				<div class="form-group"
					th:classappend="${#fields.hasErrors('nickName')} ? 'has-error'">
					<label for="nickName"
						class="col-lg-2 col-md-2 col-sm-2 hidden-xs control-label">用户昵称</label>
					<div class="col-lg-10 col-md-10 col-sm-10 col-xs-12">
						<input type="text" class="form-control input-sm"
							th:field="*{nickName}" maxLength="64" required="required"
							requireText="请输入昵称" placeHolder="用户昵称" /> <small
							class="help-block">用户昵称长度需在2到64位之间</small> <small
							class="text-warning" th:if="${#fields.hasErrors('nickName')}"
							th:errors="*{nickName}"></small>
					</div>
				</div>
				<div class="form-group"
					th:classappend="${#fields.hasErrors('email')} ? 'has-error'">
					<label for="email"
						class="col-lg-2 col-md-2 col-sm-2 hidden-xs control-label">电子邮件</label>
					<div class="col-lg-10 col-md-10 col-sm-10 col-xs-12">
						<input type="email" class="form-control input-sm"
							th:field="*{email}" maxLength="64" required="required"
							requireText="请输入电子邮件" placeHolder="电子邮件" /> <small
							class="help-block">此邮箱用于找回密码，请勿必设置为您的常用邮箱（邮箱长度不能超过64个字符）</small>
						<small class="text-warning" th:if="${#fields.hasErrors('email')}"
							th:errors="*{email}"></small>
					</div>
				</div>
				<div class="row">
					<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
						<button type="submit"
							class="col-lg-offset-3 col-md-offset-3 col-lg-5 col-md-4 col-sm-4 btn btn-lg btn-success">保存数据</button>
						<button type="reset"
							class="col-lg-offset-1 col-md-offset-1 col-sm-offset-1 btn btn-lg btn-default">重置</button>
						<a class="btn btn-lg btn-default" role="button"
							th:href="@{/users}">返回列表</a>
					</div>
				</div>
			</fieldset>
		</form>
	</div>
</body>
</html>
